Make Save button disabled after canceling User's password changes #6365
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1762791
There was a bug regarding responding of Save button (Save and Reset buttons are together enabled or disabled like one) on changes of User's password: after clicking on Cancel button for canceling editing the password (not canceling editing User's info!), Save button was still enabled even when there wasn't any change in the User's info, and after clicking on Save error occurred.
The core of the problem is
value
vs.placeholder
attribute ofpassword_field_tag
. Because of that, string with dots '●●●●●●●●' appeared inparams[:password]
after clicking on Cancel button, so then this value was copied to@edit[:new][:password]
(which wasnil
originally, at the beginning of editing User's info) and herechanged
variable was set totrue
, so then Save, Reset buttons remained enabled.Here is the place where we've set dots as a value, after canceling editing password. I don't see any reason for it. Also, the name of the variable
storedPasswordPlaceholder
used there also suggests that it's about setting the placeholder, not value.Editing User's password - Save, Reset buttons enabled as expected:
Before: (after canceling User's password change Save, Reset buttons still enabled!)
After: (after canceling User's password change Save, Reset buttons disabled as expected)